<template>
    <div>
        <CommonData title="今日交易用户数" :total="orderUser">
            <template v-slot:chart>
                <div id="box" style="width:100%;height:100%;"></div>
            </template>
            <template>
                <span>退货率</span>
                <span><b>&nbsp;&nbsp;{{ returnRate }}</b></span>
            </template>
        </CommonData>
    </div>
</template>

<script>
import topMixin from '@/mixin/topView'
import reportData from '@/mixin/reportData'
export default {
    mixins: [topMixin, reportData],
    mounted() {
        setTimeout(() => {
            var chartDom = this.$echarts.init(document.getElementById('box'));
            var options = {
                xAxis: {
                    type: 'category',
                    show: true,
                    data: this.orderUserTrendAxis,
                },
                yAxis: {
                    show: false
                },
                grid: {
                    left: 0,
                    top: 0,
                    bottom: 0,
                    right: 0,
                },
                series: [
                    {
                        data: this.orderUserTrend,
                        type: 'bar'
                    }
                ],
                tooltip: {
                    // formatter: (params) => {
                    //     return '销量' + params.data
                    // }
                }
            }
            chartDom.setOption(options);
        }, 1000)
    }
}
</script>

<style lang="scss" scoped>

</style>